/*******************************************************************************
 * Copyright (c) 2010, 2030 www.itlaobing.cn
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package cn.itlaobing.services;

import java.sql.SQLException;

import cn.itlaobing.dao.GoodsDao;
import cn.itlaobing.exception.BusinessException;

/** 
 * ClassName: GoodsService <br/> 
 * Function: 订单表服务层 <br/> 
 * date: 2017年11月1日 下午8:11:45 <br/> 
 * 
 * @author 王博 
 * @version  
 * @since JDK 1.8 
 */
public class GoodsService {
	private GoodsDao goodsDao=new GoodsDao();
	/** 
	 * updateStatusId:(更改订单状态). <br/>
	 * 
	 * @author 王博 
	 * @param id
	 * @param statusId
	 * @return
	 * @throws BusinessException 
	 * @since JDK 1.8 
	 */  
	public int updateStatusId(int id,int statusId) throws BusinessException {
		int row=0;
		try {
			row=goodsDao.updateStatusId(id, statusId);
		} catch (SQLException e) {
			throw new BusinessException(e.getMessage());
		}finally {
			try {
				goodsDao.close();
			} catch (SQLException e) {
				throw new BusinessException(e.getMessage());
			}
		}
		return row;
	}
}
